CREATE TABLE [dbo].[WorkOrders] (
    [Id]           INT            IDENTITY (1, 1) NOT NULL,
    [Description]  NVARCHAR (MAX) NULL,
    [Address]      NVARCHAR (50)  NULL,
    [CreationDate] DATETIME       NULL,
    [Longitude]    FLOAT (53)     NULL,
    [Latitude]     FLOAT (53)     NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);

CREATE TABLE [dbo].[Comments] (
    [Id]            INT            IDENTITY (1, 1) NOT NULL,
    [Message]       NVARCHAR (MAX) NULL,
    [CreationDate]  DATETIME       NULL,
    [WorkOrders_id] INT            NOT NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_Comments_ToWorkOrders] FOREIGN KEY ([WorkOrders_id]) REFERENCES [dbo].[WorkOrders] ([Id])
);

SET IDENTITY_INSERT [dbo].[WorkOrders] ON
INSERT INTO [dbo].[WorkOrders] ([Id], [Description], [Address], [CreationDate], [Longitude], [Latitude]) VALUES (1, N'order 1', N'cll 100 34 d 4', N'2011-03-04 00:00:00', 349, 78.45)
INSERT INTO [dbo].[WorkOrders] ([Id], [Description], [Address], [CreationDate], [Longitude], [Latitude]) VALUES (2, N'order 2', N'crr 45 b 54', N'2012-09-11 00:00:00', 4, 67.976)
INSERT INTO [dbo].[WorkOrders] ([Id], [Description], [Address], [CreationDate], [Longitude], [Latitude]) VALUES (3, N'order 3', N'cll 90 c 45', N'2012-12-12 00:00:00', 46, 23.9)
INSERT INTO [dbo].[WorkOrders] ([Id], [Description], [Address], [CreationDate], [Longitude], [Latitude]) VALUES (4, N'order 4', N'av cali 56 23', N'2012-11-11 00:00:00', 34.63, 10.2)
INSERT INTO [dbo].[WorkOrders] ([Id], [Description], [Address], [CreationDate], [Longitude], [Latitude]) VALUES (5, N'order 5', N'cll 456', N'2012-11-11 00:00:00', 34.789, 10.35)
INSERT INTO [dbo].[WorkOrders] ([Id], [Description], [Address], [CreationDate], [Longitude], [Latitude]) VALUES (6, N'order 6 changed', N'cll 110 34 d 4', N'2013-02-21 05:08:13', 349, 10.1)
INSERT INTO [dbo].[WorkOrders] ([Id], [Description], [Address], [CreationDate], [Longitude], [Latitude]) VALUES (7, N'order 7', N'cll 20034 d 4', N'2013-02-21 05:42:07', 23.9, 349)
SET IDENTITY_INSERT [dbo].[WorkOrders] OFF

SET IDENTITY_INSERT [dbo].[Comments] ON
INSERT INTO [dbo].[Comments] ([Id], [Message], [CreationDate], [WorkOrders_id]) VALUES (1, N'Mess for wo 1', N'2012-10-07 00:00:00', 1)
INSERT INTO [dbo].[Comments] ([Id], [Message], [CreationDate], [WorkOrders_id]) VALUES (2, N'mess for 1', N'2011-11-11 00:00:00', 1)
INSERT INTO [dbo].[Comments] ([Id], [Message], [CreationDate], [WorkOrders_id]) VALUES (3, N'comment for 2', N'2010-01-30 00:00:00', 2)
INSERT INTO [dbo].[Comments] ([Id], [Message], [CreationDate], [WorkOrders_id]) VALUES (4, N'com for order 6', N'2013-02-21 05:43:01', 6)
INSERT INTO [dbo].[Comments] ([Id], [Message], [CreationDate], [WorkOrders_id]) VALUES (5, N'com for order 6', N'2013-02-21 05:43:06', 6)
INSERT INTO [dbo].[Comments] ([Id], [Message], [CreationDate], [WorkOrders_id]) VALUES (6, N'com for order 3', N'2013-02-21 05:46:18', 3)
INSERT INTO [dbo].[Comments] ([Id], [Message], [CreationDate], [WorkOrders_id]) VALUES (7, N'com for order 3 jadn', N'2013-02-21 05:48:04', 3)
SET IDENTITY_INSERT [dbo].[Comments] OFF

V